//index.js
//获取应用实例
var app = getApp()
var promise = require('../../utils/request.js');
var util = require('../../utils/util.js');

Page({
  data:{
    id:''
  },
  toRenew: function (){
    wx.navigateTo({
      url: '../renew/renew?id=' + this.data.id+"&type=3",
    })
  },
  addLittle:function(){
    wx.navigateTo({
      url: '../addLittle/addLittle?id=' + this.data.id + "&type=2",
    })
  },
  selected:function(){
    this.class
  },
  onLoad:function(options){
    var that = this;
    console.log('id:' + options.id)
    that.data.id = options.id
    promise.sendRequest('account/' + options.id, 'Get','', null,4,{
      success:function(data){
        console.log(data)
        var timeLimit = util.formatTimeToDay(data.timeLimit)
        data.timeLimit = timeLimit;
        that.setData(data);
      }
    },{
      fail:function(res){
        console.log(res)
      }
    })
  }
})
